package cn.yunhe.action;

import cn.yunhe.biz.BookBiz;
import cn.yunhe.bizImpl.BookBizImpl;
import cn.yunhe.entity.Admin;

public class LoginAction extends BaseAction {
	private String username;
	private String password;
	
	public String execute() throws Exception {
		BookBiz bookBiz=new BookBizImpl();
		Admin admin=new Admin();
		admin.setAdminName(username);
		admin.setAdminPassword(password);
		Admin admin1=bookBiz.loginAdmin(admin);
		if(admin1!=null){
			getMapSession().put("admin", admin1);
			
			return SUCCESS;
		}else{
			return INPUT;
		}
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
}
